/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Library General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301,  USA
 */

/**
 * @version db_mysql.h 0.0.1
 * @package Comoro
 * @author Dr.NP <np@bsgroup.org>
 * 
 * BS.Play MySQL port header
 */

#include "mysql.h"

/* BEGIN OF CONSTANT */
#define MAX_MYSQL_ENV							64
/* END OF CONSTANT */

/* BEGIN OF STRUCT */
struct mysql_env
{
	int env_id;
	char *db_name;
	MYSQL *conn;
	MYSQL_RES *curr_res;
	unsigned int num_columns;
};

struct mysql_row
{
	char *name;
	char *value;
	unsigned long length;
};
/* END OF STRUCT */

/* BEGIN OF FUNCTION DEFINE */
int db_mysql_init();
int db_mysql_close();
int db_mysql_create_env(int);
int db_mysql_set_db(int, char *);
int db_mysql_close_env(int);
int db_mysql_query(int, const char *);
struct mysql_row ** db_mysql_fetch_row(int, int *);
void db_mysql_del_row(struct mysql_row **, int);
int db_mysql_num_columns(int);
/* END OF FUNCTION DEFINE */
